import service from './request'


export function getVoice(audit_status, pagenum, pagesize) {
    const searchstudent = []
    searchstudent.push({ 'value': audit_status, 'value1': 'audit_status=' + audit_status + '&' })
    let src = ''
    searchstudent.forEach(item => {
        if (item.value || typeof(item.value) == 'number') {
            src += item.value1
        }
    })
    if (audit_status) {

        return service.get('/Voice?' + src + 'page=' + pagenum + '&page_size=' + pagesize)
    } else {

        return service.get('/Voice?page=' + pagenum + '&page_size=' + pagesize)
    }
}

export function addVoice(content) {
    return service.post('/Voice', content)
}
export function removeVoice(id) {
    return service.delete('/Voice/' + id)
}

export function getVoiceItem(id) {
    return service.get('/Voice/' + id)
}

export function editVoiceItem(id, data) {
    return service.put('/Voice/' + id, data)
}
// http://101.34.188.212:8001/api/Recodings
// 获取学生基本信息接口
export function getStuMessages(pagenum, pagesize) {
    return service.get('/Recodings?page=' + pagenum + '&page_size=' + pagesize)
}
export function addStuMessages(content) {
    console.log(content);
    return service.post('/Recodings', content)
}

export function removevoice(id) {
    return service.delete('/Recodings/' + id)
}

export function getjieduanbi() {
    return service.get('/Recodings/aa')
}

export function xueyuanbi(dep, state, stage) {
    return service.get('/Recodings/bb?query=' + dep +
        "&state=" +
        state +
        "&stage_query=" +
        stage)
}

export function xueyuanbi2(dep, state, stage, stu_par) {
    return service.get('/Recodings/bb2?query=' + dep +
        "&state=" +
        state +
        "&stage_query=" +
        stage + "&stu_par=" + stu_par)
}